home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3g / p2open.z / p2open
Encoding:
Text File  |  1998-10-20  |  7.0 KB  |  132 lines

  1.  
  2.  
  3.  
  4. pppp2222ooooppppeeeennnn((((3333GGGG))))                                                          pppp2222ooooppppeeeennnn((((3333GGGG))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _pppp_2222_oooo_pppp_eeee_nnnn, _pppp_2222_cccc_llll_oooo_ssss_eeee - open, close pipes to and from a command
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _cccc_cccc [_f_l_a_g ...] _f_i_l_e ...  _----_llll_gggg_eeee_nnnn [_l_i_b_r_a_r_y ...]
  13.  
  14.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_gggg_eeee_nnnn_...._hhhh_>>>>
  15.  
  16.      _iiii_nnnn_tttt _pppp_2222_oooo_pppp_eeee_nnnn _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_c_m_d_,,,, _FFFF_IIII_LLLL_EEEE _****_f_p_[[[[_2222_]]]]_))))_;;;;
  17.  
  18.      _iiii_nnnn_tttt _pppp_2222_cccc_llll_oooo_ssss_eeee _((((_FFFF_IIII_LLLL_EEEE _****_f_p_[[[[_2222_]]]]_))))_;;;;
  19.  
  20. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  21.      _pppp_2222_oooo_pppp_eeee_nnnn forks and execs a shell running the command line pointed to by
  22.      _c_m_d.  On return, _f_p_[[[[_0000_]]]] points to a _FFFF_IIII_LLLL_EEEE pointer to write the command's
  23.      standard input and _f_p_[[[[_1111_]]]] points to a _FFFF_IIII_LLLL_EEEE pointer to read from the
  24.      command's standard output.  In this way the program has control over the
  25.      input and output of the command.
  26.  
  27.      The function returns 0 if successful; otherwise it returns -1.
  28.  
  29.      _pppp_2222_cccc_llll_oooo_ssss_eeee is used to close the file pointers that _pppp_2222_oooo_pppp_eeee_nnnn opened.  It waits
  30.      for the process to terminate and returns the process status.  It returns
  31.      0 if successful; otherwise it returns -1.
  32.  
  33. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  34.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>>
  35.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_llll_iiii_bbbb_gggg_eeee_nnnn_...._hhhh_>>>>
  36.      _mmmm_aaaa_iiii_nnnn_((((_aaaa_rrrr_gggg_cccc_,,,,_aaaa_rrrr_gggg_vvvv_))))
  37.      _iiii_nnnn_tttt _aaaa_rrrr_gggg_cccc_;;;;
  38.      _cccc_hhhh_aaaa_rrrr _****_****_aaaa_rrrr_gggg_vvvv_;;;;
  39.      _{{{{
  40.           _FFFF_IIII_LLLL_EEEE _****_ffff_pppp_[[[[_2222_]]]]_;;;;
  41.           _pppp_iiii_dddd______tttt _pppp_iiii_dddd_;;;;
  42.           _cccc_hhhh_aaaa_rrrr _bbbb_uuuu_ffff_[[[[_1111_6666_]]]]_;;;;
  43.           _pppp_iiii_dddd_====_pppp_2222_oooo_pppp_eeee_nnnn_((((_""""_////_uuuu_ssss_rrrr_////_bbbb_iiii_nnnn_////_cccc_aaaa_tttt_""""_,,,, _ffff_pppp_))))_;;;;
  44.           _iiii_ffff _(((( _pppp_iiii_dddd _!!!!_==== _0000 _)))) _{{{{
  45.                _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff_((((_ssss_tttt_dddd_eeee_rrrr_rrrr_,,,, _""""_pppp_2222_oooo_pppp_eeee_nnnn _ffff_aaaa_iiii_llll_eeee_dddd_\\\\_nnnn_""""_))))_;;;;
  46.                _eeee_xxxx_iiii_tttt_((((_1111_))))_;;;;
  47.           _}}}}
  48.           _wwww_rrrr_iiii_tttt_eeee_((((_ffff_iiii_llll_eeee_nnnn_oooo_((((_ffff_pppp_[[[[_0000_]]]]_))))_,,,,_""""_TTTT_hhhh_iiii_ssss _iiii_ssss _aaaa _tttt_eeee_ssss_tttt_\\\\_nnnn_""""_,,,, _1111_6666_))))_;;;;
  49.           _iiii_ffff_((((_rrrr_eeee_aaaa_dddd_((((_ffff_iiii_llll_eeee_nnnn_oooo_((((_ffff_pppp_[[[[_1111_]]]]_))))_,,,, _bbbb_uuuu_ffff_,,,, _1111_6666_)))) _<<<<_====_0000_))))
  50.                _ffff_pppp_rrrr_iiii_nnnn_tttt_ffff_((((_ssss_tttt_dddd_eeee_rrrr_rrrr_,,,, _""""_pppp_2222_oooo_pppp_eeee_nnnn _ffff_aaaa_iiii_llll_eeee_dddd_\\\\_nnnn_""""_))))_;;;;
  51.           _eeee_llll_ssss_eeee
  52.                _wwww_rrrr_iiii_tttt_eeee_((((_1111_,,,, _bbbb_uuuu_ffff_,,,, _1111_6666_))))_;;;;
  53.           _((((_vvvv_oooo_iiii_dddd_))))_pppp_2222_cccc_llll_oooo_ssss_eeee_((((_ffff_pppp_))))_;;;;
  54.      _}}}}
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.                                                                         PPPPaaaaggggeeee 1111
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69. pppp2222ooooppppeeeennnn((((3333GGGG))))                                                          pppp2222ooooppppeeeennnn((((3333GGGG))))
  70.  
  71.  
  72.  
  73. SEE ALSO
  74.      _ffff_cccc_llll_oooo_ssss_eeee(3S), _pppp_oooo_pppp_eeee_nnnn(3S), _ssss_eeee_tttt_bbbb_uuuu_ffff(3S)
  75.  
  76. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  77.      A common problem is having too few file descriptors.  _pppp_2222_cccc_llll_oooo_ssss_eeee returns -1
  78.      if the two file pointers are not from the same _pppp_2222_oooo_pppp_eeee_nnnn.
  79.  
  80. NNNNOOOOTTTTEEEESSSS
  81.      Buffered writes on _f_p_[[[[_0000_]]]] can make it appear that the command is not
  82.      listening.  Judiciously placed _ffff_ffff_llll_uuuu_ssss_hhhh calls or unbuffering _f_p_[[[[_0000_]]]] can be a
  83.      big help; see _ffff_cccc_llll_oooo_ssss_eeee(3S).
  84.  
  85.      Many commands use buffered output when connected to a pipe.  That, too,
  86.      can make it appear as if things are not working.
  87.  
  88.      Usage is not the same as for _pppp_oooo_pppp_eeee_nnnn, although it is closely related.
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.                                                                         PPPPaaaaggggeeee 2222
  129.  
  130.  
  131.  
  132.